function loadTrial() {
  $('.append').remove()
  $('#mainContent').append(template('t_trial'))
  exit()


  request.getHasJoinTrial(function(res) {
    var hasJoin = res.hasJoin
    $('.joinNumber').html(res.joinNumber)
    if (hasJoin === -1) {
      setActionDisplay(1, 0)
    } else {
      setActionDisplay(0, 1)
    }
  })

  request.getTrialInfo(function(res) {
    var trialInfo = res.trialInfo
    if (!trialInfo) {
      return
    }
    var fightMsgs = trialInfo.fightMsgs
    $('.record').empty()

    $('.score').html(' 胜' + trialInfo.score + '负' +  (16 - trialInfo.score))
    for (var i in fightMsgs) {
      var player1 = fightMsgs[i].p1
      var player2 = fightMsgs[i].p2
      var player1Name = player1.name
      var result = fightMsgs[i].result
      if (result === 1) {
        result = '胜'
      } else {
        result = '负'
      }
        var con = '<div class="line"><span class="p1name">' + player1.name + '</span><span class="result">' + result + '</span><span class="p2name">' + player2.name + '</span>'
      //var con = player1.name + '&nbsp;' + result + '&nbsp;' + player2.name
      con += '<button class="playBattle" value="' + i + '">查看</button></div>'
      $('.record').append(con)
    }

    $('.playBattle').click(function() {
      var value = $(this).attr('value')
      var fightMsg = player.trialInfo.fightMsgs[value]
      attacks(fightMsg)
    })
  })



  $('.joinTrial').click(function() {
    request.joinTrial(function(res) {
      showMessage('报名成功')
      setActionDisplay(0, 1)
      $('.joinNumber').html(res.joinNumber)
    })
  })



  function setActionDisplay(flag1, flag2) {
    if (flag1) {
      $('.joinTrial').css('display', 'block')
    } else {
      $('.joinTrial').css('display', 'none')
    }

    if (flag2) {
      $('.hasJoin').css('display', 'block')
    } else {
      $('.hasJoin').css('display', 'none')
    }
  }
}
